import os
import  random, csv
def id_target():
    if not os.path.exists('E:\\throiy data\\thyroidultrasoundcineclip\\metadata.csv'):
        print('no exits this file')
        # with open(os.path.join(self.root, filename), mode='w', newline='') as f:
        #     writer = csv.writer(f)
        #     for img, mask in zip(images, masks):
        #         # name=img.split(os.sep)[-2]
        #         # label=self.name2label[name]
        #
        #         writer.writerow([img, mask])
        #     print("written into csv file", filename)
    annid = []
    target = {}
    with open('E:\\throiy data\\thyroidultrasoundcineclip\\metadata.csv') as f:
        reader = csv.reader(f)
        for row in reader:
            annot_id, age,sex,location,size_x,size_y,size_z,ti_rads_composition,ti_rads_echogenicity,ti_rads_shape,ti_rads_margin,ti_rads_echogenicfoci,ti_rads_level,histopath_diagnosis= row
            annid.append(annot_id)
            target[annot_id]=histopath_diagnosis

    return annid,target
        # print(annid,target)